package cn.buk.tms.eotms.dao;

import cn.buk.tms.eotms.entity.RentalCarOrder;
import cn.buk.tms.eotms.sc.SearchCarOrderCriteria;

import java.util.List;

public interface CarOrderDao {

  int createCarOrder(RentalCarOrder order);

  /**
   * 提交订单
   * @param ownerId
   * @param userId
   * @param orderNo
   * @param vehicleTypeId 车型id
   * @param vehicleTypeName 车型名称
   * @param supplierVehicleTypeId 供应商车型id
   * @param price
   * @param discount
   * @param linkPhone
   * @param linkman
   * @param email
   * @param payType 付款方式
   * @param remark
   * @param flightOrderId 相关联的机票订单id
   * @return
   */
  int submitRentalCarOrder(int ownerId, int userId, String orderNo,
                           int vehicleTypeId, String vehicleTypeName, int supplierVehicleTypeId,
                           double price, double discount, String linkPhone, String linkman,
                           String email, int payType, String remark, int flightOrderId);

  List<RentalCarOrder> searchOrders(int ownerId, int customerId, SearchCarOrderCriteria sc);

  RentalCarOrder getOrderById(int orderId);

  int cancelRentalCarOrder(int ownerId, int customerId, String username, int orderId);

  int updateRentalCarOrderPaid(int userId, int orderId);

  int approveRentalCarOrder(int ownerId, int customerId, String username, int orderId, int denyCode, String denyReason);

  List<RentalCarOrder> searchByFlightOrderId(int ownerId, int flightOrderId);
}
